﻿namespace JNPF.Utils
{
    /// <summary>
    /// 缓存键
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// </summary>
    public static class CacheKey
    {
        /// <summary>
        /// 系统配置
        /// </summary>
        public static string SYSTEMINFO
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "systeminfo";
                else
                    return "systeminfo";
            }
        }
        /// <summary>
        /// 图片验证码
        /// </summary>
        public static string VALIDCODE
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "validcode_";
                else
                    return "validcode_";
            }
        }
        /// <summary>
        /// 登录token
        /// </summary>
        public static string LOGINTOKEN
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "login_token_";
                else
                    return "login_token_";
            }
        }
        /// <summary>
        /// 登录在线用户
        /// </summary>
        public static string LOGINONLINE
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "login_online_";
                else
                    return "login_online_";
            }
        }
        /// <summary>
        /// 登录在线用户 - 移动APP
        /// </summary>
        public static string MOBILELOGINONLINE
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "login_online_mobile_";
                else
                    return "login_online_mobile_";
            }
        }
        /// <summary>
        /// 移动设备列表
        /// </summary>
        public static string MOBILEDEVICELIST
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "mobiledevicelist";
                else
                    return "mobiledevicelist";
            }
        }
        /// <summary>
        /// 短信验证码
        /// </summary>
        public static string SMSVALIDCODE
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "sms_validcode_";
                else
                    return "sms_validcode_";
            }
        }
        /// <summary>
        /// 业务单据
        /// </summary>
        public static string BILLRULE
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "billrule_";
                else
                    return "billrule_";
            }
        }
        /// <summary>
        /// 用户权限集合
        /// </summary>
        public static string USERAUTHORIZE
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "authorize_";
                else
                    return "authorize_";
            }
        }

        /// <summary>
        /// 用户集合
        /// </summary>
        public static string USERLIST
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "userlist";
                else
                    return "userlist";
            }
        }

        /// <summary>
        /// 部门集合
        /// </summary>
        public static string ORGANIZELIST
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "organizelist";
                else
                    return "organizelist";
            }
        }

        /// <summary>
        /// 岗位集合
        /// </summary>
        public static string POSITIONLIST
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "positionlist";
                else
                    return "positionlist";
            }
        }

        /// <summary>
        /// 角色集合
        /// </summary>
        public static string ROLELIST
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "rolelist";
                else
                    return "rolelist";
            }
        }

        /// <summary>
        /// 远端数据
        /// </summary>
        public static string DYNAMIC
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "dynamic_";
                else
                    return "dynamic_";
            }

        }

        public static string VISUALDEV
        {
            get
            {
                var tenantId = TenantProvider.GetTenant.TenantId;
                if (!string.IsNullOrEmpty(tenantId))
                    return tenantId + "visualdev_";
                else
                    return "visualdev_";
            }
        }
    }
}
